<!DOCTYPE html>
<!-- saved from url=(0060)http://www.dengyukeji.cn/Mobile/Show/action?page=orderCenter -->
<html lang="en">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <title>订单中心</title>
        <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link href="/Public/Home/css/weui.min.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="/Public/Home/css/weui-ext.css">
        <link href="/Public/Home/css/orderCenter.css" rel="stylesheet">
        <style>
            .btn {
                background: none;
                border: 1px solid #5c89e7;
                color: #5c89e7;
                font-size: 12px;
                padding: 0 5px;
                margin-top: 0;
                cursor: pointer;
            }

            .weui-form-preview__value {
                text-align: left;
                font-size: 13px;
            }

            .statusblock {
                position: relative;
            }

            .status {
                position: absolute;
                right: 15px;
                top: 50%;
                transform: translate(0, -50%);
                font-size: 20px;
                color: #000;
            }

            .weui-form-preview__value {
                margin-right: 40px;
            }

            .page {
                padding-bottom: 50px;
            }

            #menu {
                height: 50px;
                line-height: 50px;
                display: flex;
                align-content: center;
                align-items: center;
                justify-content: space-between;
                position: fixed;
                bottom: 0;
                left: 0;
                z-index: 99;
                width: 100%;
                background: #fff;
                border-top: 1px solid #eee;
            }

            #menu .menu-item {
                height: 100%;
                flex: 1;
                text-align: center;
            }

            .br {
                border-right: 1px solid #eee;
            }
        </style>
    </head>

    <body>

        <div class="page">


            <div class="page__hd">
                <div class="hdMenu page__content">
                    <div class="hdMenu__item bbtm">
                        <div class="menuText">
                            <span>取货时间</span>
                        </div>
                        <div class="tabBtn day">
                            <div data-id="1" class="labelBtn ">昨天</div>
                            <div data-id="2" class="labelBtn active">今天</div>
                            <div data-id="3" class="labelBtn">明天</div>
                        </div>
                    </div>
                    <div class="hdMenu__item">
                        <div class="menuText">
                            <span>订单类型</span>
                        </div>
                        <div class="tabBtn type">
                            <div data-id="1" class="labelBtn  active">未入柜</div>
                            <div data-id="2" class="labelBtn">已入柜</div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="page__bd page__content">
                <!-- <p class="menuTitle">显示近3天数据，输入单号可查询近一个月数据</p> -->
                <div class="order_list">
                    <div id="orderCenter_template">

                    </div>
                </div>
            </div>


            <div id="menu">
                <div class="menu-item br" id="account">
                    <i></i>
                    <span>商家中心</span>
                </div>
                <div class="menu-item" id="guizi">
                    <i></i>
                    <span>柜体中心</span>
                </div>
            </div>

            <div id="loadingToast" style="display:none;">
                <div class="weui-mask_transparent"></div>
                <div class="weui-toast">
                    <i class="weui-loading weui-icon_toast"></i>
                    <p class="weui-toast__content">没有更多了</p>
                </div>
            </div>
        </div>
        <script src="/Public/Home/js/zepto.min.js"></script>
        <script src="/Public/Home/js/weui.min.js"></script>
        <script src="/Public/Home/js/zepto.ajax.js"></script>
        <script src="/Public/Home/js/template.js"></script>
        <script src="/Public/Home/js/orderCenter.js"></script>
        <script>

            $('#account').on('click', function() {
                window.location.href = "/Home/Orders/index"; // 
            })
            $('#guizi').on('click', function() {
                window.location.href = "/Home/Orders/guizi"; // 
            })
            $('body').on('click', '.btn', function() {
                var order_no = $(this).parent().prev().html();
                console.log(order_no)
                $.post('/Home/Orders/tabDoor', {order_no: order_no}, function(res) {
                    $('#loadingToast .weui-toast__content').html(res.msg);
                    $('#loadingToast').show(100);

                    setTimeout(function() {
                        $('#loadingToast').hide(100);
                        var time = $('.day .active').attr('data-id');
                        var type = $('.type .active').attr('data-id');
                        $.post('/Home/Orders/index', {time: time, type: type}, function(data) {
                            var data_template = {
                                order_list: [data.data],
                                type: $('.type .active').attr('data-id')
                            }
                            var html = template('business', data_template);
                            $('.order_list').html(html)
                        });
                    }, 2000);
                })
            })
        </script>
    </body>

</html>